package com.niit.session7.loop;

import java.util.Scanner;

public class UserLogin1 {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String username;
		String password;
//		do...while循环会先执行一遍，再判断条件，如果条件为true会继续循环，否则就跳出循环
		do {
			System.out.print("请输入用户名：");
			username = sc.next();
			System.out.print("请输入密码：");
			password = sc.next();
		} while (!(username.equals("trout") && password.equals("123456")));
		System.out.println("登录成功！");
	}

}
